// Main method
ajax: function( url, options ) {
- // If options is not an object,
- // we simulate pre-1.5 signature
- if ( typeof options !== "object" ) {
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
options = url;
url = undefined;
}
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
});
+test( "jQuery.ajax - multiple method signatures introduced in 1.5 ( #8107)", 4, function() {
+
+ expect( 3 );
+
+ var i = 3;
+
+ jQuery.ajaxSetup({success: function() {
+ ok( true, "Success");
+ if ( ! --i ) start();
+ }});
+
+ stop();
+ jQuery.ajax('data/name.html');
+ jQuery.ajax('data/name.html', {} );
+ jQuery.ajax({ url: 'data/name.html'} );
+
+ jQuery.ajaxSetup({ success: null });
+});
+
}
//}
\ No newline at end of file